package com.sinocare.report.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sinocare.common.entity.vo.Across;
import com.sinocare.common.entity.vo.Consumer;
import com.sinocare.report.mapper.AcrossMapper;
import com.sinocare.report.mapper.ConsumerMapper;
import com.sinocare.report.service.AcrossService;
import com.sinocare.report.service.ConsumerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ConsumerServiceImpl extends ServiceImpl<ConsumerMapper, Consumer> implements ConsumerService {
    @Resource
    private ConsumerMapper consumerMapper;

    @Override
    public List<Consumer> query(Consumer consumer) {
        List<Consumer> query = consumerMapper.query(consumer);
        for (Consumer consumer1: query ) {
            System.out.println("谷瀚好帅"+consumer1);
            Integer count_of_test = consumer1.getCount_of_test();
            Double medical_reference = consumer1.getMedical_reference();
            Integer gh=(int)(count_of_test*medical_reference);
            System.out.println("谷瀚"+gh);
            consumer1.setHw(gh+"%");

        }
        return consumerMapper.query(consumer);
    }
}
